Set focus when the current page changes. Pointed out by Eitan Isaacson
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 17 Feb 2009 05:36:12 +0000 (05:36 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 17 Feb 2009 05:36:12 +0000 (05:36 +0000)
        * gtk/gtkassistant.c (set_current_page): Set focus when the current
        page changes. Pointed out by Eitan Isaacson

svn path=/trunk/; revision=22344

ChangeLog
gtk/gtkassistant.c

index fff77d86c7081a9faa03a3e963a663497946234f..c953f339caf35ade9c265b124caa93b7d2ae87be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-02-16  MatthiasClasen  <mclasen@redhat.com>
+
+       Bug 572041 – Focus should change when advancing forward in GtkAssistant
+
+       * gtk/gtkassistant.c (set_current_page): Set focus when the current
+       page changes. Pointed out by Eitan Isaacson
+
+2009-02-16  MatthiasClasen  <mclasen@redhat.com>
+
+       * configure.in: Require GLib 2.19.7 for GMountOperation::aborted.
+
+       * gtk/gtkmountoperation.c: Implement GMountOperation::aborted.
+
 2009-02-16  Sven Neumann  <sven@gimp.org>
 
        * gdk/gdk.symbols
index f2b73156015eee1f5e090d000db7048480665f58..45748b695268610b445f78151f27f8799a12856b 100644 (file)
@@ -559,6 +559,28 @@ set_current_page (GtkAssistant     *assistant,
       gtk_widget_unmap (old_page->title);
     }
 
+  if (!gtk_widget_child_focus (priv->current_page->page, GTK_DIR_TAB_FORWARD))
+    {
+      GtkWidget *button[6];
+      gint i;
+
+      /* find the best button to focus */
+      button[0] = assistant->apply;
+      button[1] = assistant->close;
+      button[2] = assistant->forward;
+      button[3] = assistant->back;
+      button[4] = assistant->cancel;
+      button[5] = assistant->last;
+      for (i = 0; i < 6; i++)
+        {
+          if (GTK_WIDGET_VISIBLE (button[i]) && GTK_WIDGET_SENSITIVE (button[i]))
+            {
+              gtk_widget_grab_focus (button[i]);
+              break;
+            }
+        }
+    }
+
   gtk_widget_queue_resize (GTK_WIDGET (assistant));
 }